package com.jason.order.model;

import com.jason.order.dao.entity.Order;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;

@Data
public class OrderModel {

    private String id;

    private Integer userId;

    private Integer itemId;

    // 单价
    private BigDecimal unitPrice;

    // 数量
    private Integer amount;

    // 总价
    private BigDecimal totalPrice;

    public Order getOrder() {
        Order order = new Order();
        BeanUtils.copyProperties(this, order);
        return order;
    }
}
